package com.example.neo4j.config;

import org.neo4j.driver.Driver;
import org.neo4j.driver.SessionConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.neo4j.core.Neo4jClient;
import org.springframework.data.neo4j.core.Neo4jTemplate;

@Configuration
public class Neo4jConfig {

    @Bean
    public Neo4jTemplate neo4jTemplate(Neo4jClient client) {
        return new Neo4jTemplate(client);
    }

    @Bean
    public SessionConfig sessionConfig(Driver driver) {
        return SessionConfig.builder()
                .withDatabase("three-country")
                .build();
    }
}
